<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            border: 1px solid lightslategray;
            width: 450px;
            margin: 20px auto;
            height: 350px;
        }

        li {
            list-style: none;

        }

        ul {
            overflow: hidden;
        }

        ul>li {
            height: 50px;
            width: 150px;
            background: lightslategray;
            float: left;
            text-align: center;
            font: 20px/50px "";
            color: #fff;
            cursor: pointer;
        }
        ul>li.active{
            background: #fff;
            color: lightslategray;;
        }

        ol {
            position: relative;
        }

        ol>li {
            width: 450px;
            height: 300px;
            font: 50px/300px "";
            color: #fff;
            background: lightsteelblue;
            text-align: center;
            display: none;
            justify-content: center;
            align-items: center;
            position: absolute;
            left: 0;
            top: 0;
        }

        ol>li.active {
            display: flex;
        }
    </style>
</head>

<body>
    <div>
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ol>
    </div>
</body>
</html>
<script src='https://code.jquery.com/jquery-3.6.0.min.js'></script>
<script>
    $('ul>li').click(function(){
        $(this).siblings().removeClass('active').end().addClass('active');
        let index=$(this).index();
        $('ol>li:eq('+index+')').siblings().removeClass('active').end().addClass('active');
        // console.log(index)
    })
</script>